/**
author: sailing
date: 2016/11/21
****/
<style lang='less'>
.el-select .el-input {
  width: 80px;
}
.searchTab {
  z-index: 4000;
  width: 1000px;
  position: relative;
  display: flex;
  line-height: 40px;
  height: 40px;
  margin-left:5px;
  .rowLeft{
    margin-left:10px;
  };
}
</style>

<template>
  <div class='searchTab'>
    <li class='rowLeft'>
      字段类型
    </li>
    <li class='rowLeft'>
      <el-select  v-model="value" placeholder="请选择">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value">
        </el-option>
      </el-select>
    </li>
    <li class='rowLeft'>
      字段名称
    </li>
    <li class='rowLeft'>
     <el-input v-model="inputSearch"  placeholder=""></el-input>
    </li>
    <li class='rowLeft'>
     <el-button type="primary" @click="clickSearch()" icon="search">查询</el-button>
    </li>
  </div>
</template>
<script>
import Vue from 'vue'
import eventBus from '../eventBus'
export default {
  data () {
    return {
      left: 180,
      inputSearch: '',
      flag: true,
      options: [{
          value: 'level',
          label: '日志级别'
        }, {
          value: 'username',
          label: '用户名'
        }, {
          value: 'ip',
          label: 'IP'
        }],
        value: ''
    }
  },
  methods: {
    clickSearch () {
      var obj = {
        key: this.value,
        value: this.inputSearch
      }
      this.$parent.search(obj)
    }
  }
}
</script>
